<?php
class fbWall extends CI_Controls{
	//visitar http://www.neosmart.de/social-media/facebook-wall/
	public $accessToken;
	public $showGuestEntries;
	public $showComments;
	/**
	 *
	 * numero maximo de comentarios
	 * @var int
	 */
	public $max;

	public $timeConversion;

	public $fbId;
	function __construct(){
		parent::__construct();
		$this->showGuestEntries=true;
		$this->showComments=true;
		$this->max=5;
		$this->timeConversion=24;

	}

	function drawContent(){
		$wall=new div();
		$wall->atributos=$this->atributos;
		$this->fbWallScript();
		return $wall;

	}


	private function fbWallScript(){

		ob_start();
		$this->CI->dynamic_assets->add_js(base_url('js/vendor/jquery.neosmart.fb.wall.js'));
		$this->CI->dynamic_assets->add_css(base_url('js/vendor/jquery.neosmart.fb.wall.css'));
		?>
			<script>
			$(function(){

				$('#<?php echo $this->att('id')?>').fbWall({
					id:'<?php echo $this->fbId;?>',
					accessToken:'<?php echo $this->accessToken?>',
					showGuestEntries:<?php echo $this->showGuestEntries?>,
					showComments:<?php echo $this->showComments?>,
					max:<?php echo $this->max;?>,
					timeConversion:<?php echo $this->timeConversion?>});
			    
			});
			</script>
​
		<?php
			
		 $this->CI->dynamic_assets->add_code_js(ob_get_clean());
			
	}
}